using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Diagnostics;
using System.Windows.Forms;
using System.IO;

namespace IGlobalist.Classes
{
    [RunInstaller(true)]
    public partial class CustomInstaller : Installer
    {
        public CustomInstaller()
        {
            InitializeComponent();
        }
        protected override void OnCommitting(System.Collections.IDictionary savedState)
        {
            base.OnCommitting(savedState);
            string path =  Path.GetDirectoryName(this.GetType().Assembly.Location);
            string path1 = "/s \"" + Path.Combine(path, "CaptureFilter.ax") + "\"";
            string path2 = "/s \"" + Path.Combine(path, "CxpRtpFilters.ax") + "\"";            
            //MessageBox.Show("register COM :\n" + path1 + "\n" + path2);            
            ProcessStartInfo psi = new ProcessStartInfo("regsvr32",path1);
            Process.Start(psi);
            psi = new ProcessStartInfo("regsvr32", path2);
            Process.Start(psi);
        }
        protected override void OnAfterUninstall(System.Collections.IDictionary savedState)
        {
            base.OnAfterUninstall(savedState);            
        }
    }
}